<template>
  <div>
    <dynamic-specs 
      v-model="specsData" 
      @change="handleSpecsChange"
    />
    
    <el-button @click="submitForm">提交</el-button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import DynamicSpecs from '@/components/merchandiseManagement/DynamicSpecs.vue'

// 规格数据
const specsData = ref([
  {
    id: 'weight',
    name: '重量',
    values: [
      { id: '1kg', name: '1kg', valueName: '1kg' },
      { id: '2kg', name: '2kg', valueName: '2kg' }
    ]
  }
])

// 规格变化回调
const handleSpecsChange = (specs) => {
  console.log('规格变化:', specs)
}

// 提交表单
const submitForm = () => {
  console.log('最终规格数据:', specsData)
}
</script>